package priv.ln.selfdefine.exer1;

import org.junit.Test;

import java.util.HashMap;

/**
 * ClassName: DAOTest
 * Package: priv.ln.selfdefine.exer1
 * Description:
 *
 * @Author 辣辣
 * @Create 2024/8/4 13:56
 * @Version 1.0
 */
public class DAOTest {
    @Test
    public void test(){
        DAO<User> dao = new DAO<>(new HashMap<>());


        dao.save("1001",new User(1,22,"tom"));
        dao.save("1002",new User(2,24,"jack"));

        System.out.println(dao.get("1002"));

        dao.update("1002",new User(2,18,"jack"));

        System.out.println(dao.get("1002"));

        System.out.println(dao.list());

        dao.delete("1001");

        System.out.println(dao.list());
    }


}
